package com.xjoyt.pay.master.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.dto.PageParam;
import com.xjoyt.pay.dto.PageResult;
import com.xjoyt.pay.master.interfaces.DistributorChannelContract;
import com.xjoyt.pay.master.params.DistributorChannelPageParam;
import com.xjoyt.pay.master.po.DistributorChannel;
import com.xjoyt.pay.master.services.DistributorChannelService;
import com.xjoyt.pay.master.vo.DistributorChannelMap;

@RestController
@RequestMapping("distributorChannel")
public class DistributorChannelController extends AbstractController implements DistributorChannelContract {

	@Autowired
	private DistributorChannelService distributorChannelService;

	@Override
	public PageResult<DistributorChannel> loadPageChannel(@RequestBody PageParam<DistributorChannelPageParam> param) {
		return distributorChannelService.loadPageChannel(param);
	}

	@Override
	public ExecuteResult<?> remove(@PathVariable("id") String id) {
		return distributorChannelService.delete(id);
	}

	@Override
	public ExecuteResult<?> save(@RequestBody DistributorChannelMap param) {
		return distributorChannelService.save(param);
	}
}
